import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
import App from './app.vue'

import './assets/styles/global.styl'
import createRouter from './config/router'
import createStore from './store/store'

Vue.use(Vuex)
Vue.use(VueRouter)
// 注册一个新的模块
// store.registerModule('c',{
//   state:{
//     text:3
//   }
// })

// state监听
// store.watch((state) => state.count + 1, () => {
//   console.log(1)
// })
// 监听mutation
// store.subscribe((mutation,state) => {
//   console.log(1)
// })
// 监听action
// store.subscribeAction((actions,state) => {
//   console.log(1)
// })

const router = createRouter()
const store = createStore()
new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#root')
